/*
 * icenter page
**/
<template>
<div>
<div class="quick-footernav"><router-link to="/index" class="ui-btn">返回首页</router-link></div>
<div class="mod-page-tit">问题反馈</div>
<div class="weui-cells weui-cells_form">
    <div class="weui-cell">
        <div class="weui-cell__bd">
            <textarea class="weui-textarea" v-model="content" placeholder="请详细描述您遇到的问题..." rows="5"></textarea>
        </div>
    </div>
</div>
<div class="weui-btn-area"><button class="weui-btn reset-color" @click="submitUserFaq">提交</button></div>
<modal-dialog ref="dialog"></modal-dialog>
</div>
</template>
<script>
import vTab from 'components/common/tab'
import modalDialog from '../../components/dialog'
import {userFaq} from 'src/service/getData'
export default {
  data () {
    return {
      content: ''
    }
  },
  components: {
    'v-tab': vTab, modalDialog
  },
  mounted () {
  },
  methods: {
    async submitUserFaq () {
      if (!this.content) {
        this.$refs.dialog.confirm('<p class="tc">提交失败！</p><br><p class="tc">请详细描述您遇到的问题...</p>', {
          type: 'toast'
        })
      } else {
        await userFaq(this.content)
        this.$refs.dialog.confirm('<p class="tc">提交成功！</p><br><p class="tc">我们已收到您的反馈信息。</p>', {
          type: 'toast'
        }).then(() => {
          this.content = ''
        })
      }
    }
  }
}
</script>
<style>
.reset-color{background-color:#ff602a;}
.reset-color:active,
.reset-color.active{background-color:#d94544;}
</style>
